Observation of a sample with a microscope generally requires three dimensional adjustment of focus. Indeed, imaging a specific zone of a sample to be investigated (also referred to as investigation zone) may require both alignment of the investigation zone on an optical axis of the microscope (also referred to as XY-positioning) and superposition of the investigation zone with a focus plane of the microscope (also referred to as Z-positioning). These adjustments may be performed automatically using an autofocus system cooperating with the microscope.
Autofocus systems relative to the Z-positioning may perform a depth scanning of the sample over a scanning depth interval by varying a distance between the focus plane of the microscope and a movable carrier intended to receive the sample and thereafter compute a focus function for the images captured while scanning the sample in depth. Numerous functions which are expected to be at a maximum when the image reaches a highest level of sharpness or contrast have been proposed in the literature for focusing optical instruments because proper focus intuitively relates to image sharpness and/or contrast. For example, such functions involve determination of standard deviation, absolute-value deviation from a mean, entropy and differentials (gradient or Laplacian) of an image area. FIG. 1 illustrates a typical focus curve representing variations of such function with the position of the focus plane along the Z axis (optical axis) which may be obtained by carrying out such classical methods on a sample wherein a selected investigation level Zinv is derived by the position corresponding to the maximum of the function.